package org.fing.edu.uy.esbadp.support;

import java.util.Date;
import java.util.List;
import java.util.Map;

import org.fing.edu.uy.esbadp.core.AdpFlowInterface;
import org.fing.edu.uy.esbadp.core.AdpFlowLIST;
import org.fing.edu.uy.esbadp.core.AdpFlowSYNC;
import org.fing.edu.uy.esbadp.core.AdpFlowTree;
import org.fing.edu.uy.esbadp.core.AdpFlowUNI;
import org.fing.edu.uy.esbadp.core.entity.DMRegisteredService;
import org.fing.edu.uy.esbadp.core.entity.GenericTreeNode;
import org.fing.edu.uy.esbadp.core.entity.PropertiesMonitoring;
import org.fing.edu.uy.esbadp.core.interfaces.IAdpStrategy;

public class PruebaEstrategia implements IAdpStrategy  {

	
	public AdpFlowTree getAdpTree() {
		AdpFlowTree flow = new AdpFlowTree();
		flow.setExpiredDate(new Date());		
		
		AdpFlowInterface action;
		GenericTreeNode<AdpFlowInterface> treeNode = null;
		GenericTreeNode<AdpFlowInterface> treeRoot;
		
				
		//AGREGO EL LIST
		GenericTreeNode<AdpFlowInterface> treeNodeList = new GenericTreeNode<AdpFlowInterface>();
		action = new AdpFlowLIST();
		treeNodeList.setData(action);		
				
		//agrego los hijos de list1 el sync
		GenericTreeNode<AdpFlowInterface> treeNodeListChild1SYNC = new GenericTreeNode<AdpFlowInterface>();
		action = new AdpFlowSYNC("EchoWSProxy", "test",false,1000,1000);		
		treeNodeListChild1SYNC.setData(action);
		treeNodeList.addChildAt(0, treeNodeListChild1SYNC);
		
		//agrego los hijos de list1 el UNI
		GenericTreeNode<AdpFlowInterface> treeNodeListChild1UNI = new GenericTreeNode<AdpFlowInterface>();
		action = new AdpFlowUNI();
		treeNodeListChild1UNI.setData(action);
		treeNodeListChild1SYNC.addChildAt(0, treeNodeListChild1UNI);
		
							
		//agrego los hijos de list2  el sync
		GenericTreeNode<AdpFlowInterface> treeNodeListChild2SYNC = new GenericTreeNode<AdpFlowInterface>();
		action = new AdpFlowSYNC("EchoWSProxyMirror1", "test",false,1000,1000);		
		treeNodeListChild2SYNC.setData(action);
		treeNodeList.addChildAt(0, treeNodeListChild2SYNC);
				
		//agrego los hijos de list 2 el UNI
		GenericTreeNode<AdpFlowInterface> treeNodeListChild2UNI = new GenericTreeNode<AdpFlowInterface>();
		action = new AdpFlowUNI();
		treeNodeListChild2UNI.setData(action);
		treeNodeListChild2SYNC.addChildAt(0, treeNodeListChild2UNI);
		
		
				
		GenericTreeNode<AdpFlowInterface> treeNodeListChild3 = new GenericTreeNode<AdpFlowInterface>();
		action = new AdpFlowSYNC("EchoWSProxyMirror2", "test",false,1000,1000);	
		treeNodeListChild3.setData(action);
		treeNodeList.addChildAt(0, treeNodeListChild3);		
		
		//agrego los hijos de list 3 el UNI
		GenericTreeNode<AdpFlowInterface> treeNodeListChild3UNI = new GenericTreeNode<AdpFlowInterface>();
		action = new AdpFlowUNI();
		treeNodeListChild3UNI.setData(action);
		treeNodeListChild3.addChildAt(0, treeNodeListChild3UNI);
		
		flow.setFlowTree(treeNodeList);
		//flow.getCurrent().addChildAt(0, treeNodeList);
		flow.resetCurrent();		
	
		return flow;
	}

	public AdpFlowTree getAdpTree(DMRegisteredService service,
			List<DMRegisteredService> equivServices,
			PropertiesMonitoring properties) {
		// TODO Auto-generated method stub
		return null;
	}
	
}
